Trigger that fires on enter attribute field during edit

Hi!

I need a trigger that fires, when the user is entering a field and before typing s.th. (just entering the field by doubleclick in edit mode)

I tried

pre write

pre save

pre modify

post write

post save

post modify

but nothing happens when entering (only after modifying)

trigger(NameTrig, module->attribute, pre, modify, 6, DXLCode)

Can s.o. tell me how to set params on the trigger() Function to fire after entering a field?


Bjoern_Karpenstein - Wed Jul 22 09:28:06 EDT 2015

Re: Trigger that fires on enter attribute field during edit
Bjoern_Karpenstein - Wed Jul 22 09:47:44 EDT 2015

Hi i got it with this:

 

My only problem now is, that i want to show a DB Window on mouse position, and the main window wants to get back focus,

so that the open DB Window disappears in Background.

 

string DXLCode = "
        Trigger    trg = current;           
        if (null trg) halt(); 
        AttrDef ad  = attrdef(trg); 
        if (null ad) halt();  // Error?
        Object  obj = object(trg);  
        if (null obj) halt();  // Error?
        string  Name = ad.name;   
        print Name;  
        if (Name != \"BB_Trigger_Test\") halt()

        // Switches off DXL run-time errors until lastError is called
        //infoBox \"Drin!\"
        
        noError()
        //obj.\"BB_Trigger_Test\" = \"Test2\"
        
        
        void changeWorkflowStep(DBE x)
        {
                string selectedWFStep = get x;
                infoBox selectedWFStep;
        }

        string workflowStepsArray[] = {};
        DB selectionWindow = create(\"Select next Workflow Step\");
        DBE dropDownBoxSelectWorkflowStep=choice(selectionWindow,\"Select Workflow Step:\", workflowStepsArray,0,0,40, false);
        set(dropDownBoxSelectWorkflowStep,changeWorkflowStep);
        realize(selectionWindow);
        show (selectionWindow);
        
        
        lastError()
"      // End definition of string DXLCode
 
Trigger trg;
bool    TrigOK  = true;
string  ErrMess = checkDXL(DXLCode);
 
if (!null ErrMess)
{
   print ErrMess "\n***********\n" DXLCode "**********\n"
   TrigOK       = false
}
 
string  NameTrig = "TriggerResetValidatedOn"
 
string  Prompt = "Delete trigger '" NameTrig "' ??"
if (!TrigOK) Prompt = "Trigger code has errors.\n" Prompt
if (confirm(Prompt))
{
   ErrMess = delete (NameTrig, module->object, post, open, 6);
}
 
if (TrigOK && confirm("Deploy trigger '" NameTrig "' ??"))
{
   trg     = trigger(NameTrig, module->object, post, open, 6, DXLCode)
}